﻿<Window x:Class="Huknow.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="600" Width="800" WindowStartupLocation="CenterScreen" ResizeMode="CanResizeWithGrip" MinWidth="640" MinHeight="480"
        xmlns:wpf="clr-namespace:TheArtOfDev.HtmlRenderer.WPF;assembly=HtmlRenderer.WPF" Icon="Huknow.ico" Title="Huknow">
    <Grid x:Name="WindowGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="{Binding ActualHeight, ElementName=TBP, Mode=OneWay}"/>
            <RowDefinition/>
            <RowDefinition Height="140"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="140"/>
            <ColumnDefinition/>
            <ColumnDefinition Width="240"/>
        </Grid.ColumnDefinitions>
        <!--<ProgressBar x:Name="progressBar" Height="26" Margin="10,0,10,10" VerticalAlignment="Bottom" Grid.ColumnSpan="3" Grid.Row="2"/>-->
        <StatusBar Margin="10,0,10,10" Height="30" VerticalAlignment="Bottom" Grid.ColumnSpan="3" Grid.Row="2" Background="{x:Null}">
            <StatusBarItem x:Name="CurrentWebClientStatus" Content="..."/>
            <ComboBox x:Name="Progresses">
                <Grid>
                    <TextBlock><Run Text="http://www.codeproject.com/"/></TextBlock>
                    <ProgressBar Width="{Binding Width, ElementName=progressBar}" Height="6"/>
                </Grid>
                <Grid>
                    <TextBlock><Run Text="//dj9okeyxktdvd.cloudfront.net/App_Themes/CodeProject/Img/Christmas/logo250x135.gif"/></TextBlock>
                    <ProgressBar Width="{Binding Width, ElementName=WindowGrid}" Height="6"/>
                </Grid>
                <Grid>
                    <TextBlock><Run Text="..."/></TextBlock>
                    <ProgressBar Width="{Binding Width, ElementName=WindowGrid}" Height="6"/>
                </Grid>
                <Grid>
                    <TextBlock><Run Text="..."/></TextBlock>
                    <ProgressBar Width="{Binding Width, ElementName=WindowGrid}" Height="6"/>
                </Grid>
                <Grid>
                    <TextBlock><Run Text="..."/></TextBlock>
                    <ProgressBar Width="{Binding Width, ElementName=WindowGrid}" Height="6"/>
                </Grid>
                <Grid>
                    <TextBlock><Run Text="..."/></TextBlock>
                    <ProgressBar Width="{Binding Width, ElementName=WindowGrid}" Height="6"/>
                </Grid>
            </ComboBox>
        </StatusBar>
        <TreeView x:Name="PageTreeView" Margin="10,10,10,72" SelectedItemChanged="PageTreeView_SelectedItemChanged" Grid.Row="1" Grid.RowSpan="2">
            <TreeView.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Goto..." Click="MenuItem_Click"/>
                </ContextMenu>
            </TreeView.ContextMenu>
        </TreeView>
        <TextBox x:Name="SelElemByPath" Text=".//*[@src]" KeyUp="SelElemByPath_KeyUp" VerticalAlignment="Bottom" Margin="10,0,10,45" Grid.Row="2"/>
        <TabControl x:Name="Tabs" Margin="10" Grid.Column="2" Grid.RowSpan="2">
            <TabItem Header="Attributes">
                <Grid Background="#FFE5E5E5">
                    <DataGrid x:Name="AttrGrid" AutoGenerateColumns="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Name, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Name"/>
                            <DataGridTextColumn Binding="{Binding Value, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Value"/>
                            <DataGridTextColumn Binding="{Binding XPath, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="XPath"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
            <TabItem Header="Childs">
                <Grid Background="#FFE5E5E5">
                    <DataGrid x:Name="ChildGrid" AutoGenerateColumns="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Name, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Name"/>
                            <DataGridTextColumn Binding="{Binding Id, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Id"/>
                            <DataGridTextColumn Binding="{Binding Closed, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Closed"/>
                            <DataGridTextColumn Binding="{Binding XPath, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="XPath"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
            <TabItem>
                <TabItem.Header>
                    <StackPanel Orientation="Horizontal">
                        <Ellipse Width="10" Height="10" Fill="DarkGray"/>
                        <TextBox x:Name="SelPath" KeyUp="SelPath_KeyUp">.//*[@href]</TextBox>
                    </StackPanel>
                </TabItem.Header>
                <Grid Background="#FFE5E5E5">
                    <DataGrid x:Name="LinkGrid" AutoGenerateColumns="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Name, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Name"/>
                            <DataGridTextColumn Binding="{Binding Id, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Id"/>
                            <DataGridTextColumn Binding="{Binding Closed, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Closed"/>
                            <DataGridTextColumn Binding="{Binding XPath, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="XPath"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
        </TabControl>
        <!--<TextBox x:Name="textHtml" Margin="10,10,10,41" HorizontalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True" VerticalScrollBarVisibility="Visible" IsReadOnly="True" Grid.Row="2" Grid.ColumnSpan="2" Grid.Column="1"/>-->
        <GridSplitter Grid.Column ="0" HorizontalAlignment="Right" Margin="0,10,0,45" VerticalAlignment="Stretch" Width="5" Grid.Row="1" Grid.RowSpan="2" ShowsPreview="True" Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}"/>
        <GridSplitter Grid.Column="2" HorizontalAlignment="Left" Margin="0,10" Width="5" ShowsPreview="True" Grid.RowSpan="2" Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}"/>
        <GridSplitter Grid.Row="2" Height="5" Margin="10,0" VerticalAlignment="Top" ResizeDirection="Rows" HorizontalAlignment="Stretch" Grid.ColumnSpan="2" Grid.Column="1" ShowsPreview="True" Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}"/>
        <ToolBarPanel x:Name="TBP" Margin="10,10,10,0" Grid.ColumnSpan="2" Height="90" VerticalAlignment="Top">
            <ToolBarPanel.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Address"/>
                    <MenuItem Header="Navigation"/>
                    <MenuItem Header="Formatting"/>
                </ContextMenu>
            </ToolBarPanel.ContextMenu>
            <ToolBar x:Name="AddressToolbar" Margin="0,0,0,0">
                <Button Content="SendEthPacket" Click="Button_Click" Visibility="Collapsed"/>
                <TextBox x:Name="AddressBox" Margin="0" Width="342" KeyDown="TextBox_KeyDown" BorderThickness="2" Text="http://stackoverflow.com/"/>
                <ComboBox Width="15" SelectionChanged="ComboBox_SelectionChanged">
                    <ComboBoxItem Content="http://www.odesk.com/"/>
                    <ComboBoxItem Content="http://habrahabr.ru/"/>
                    <ComboBoxItem Content="http://www.codeproject.com/"/>
                    <ComboBoxItem Content="http://www.fast-torrent.ru/"/>
                    <ComboBoxItem Content="http://fineworld.org/"/>
                    <ComboBoxItem Content="http://stackoverflow.com/"/>
                </ComboBox>
                <Button x:Name="GoButton" Content="Go" Click="GoButton_Click"/>
            </ToolBar>
            <ToolBar x:Name="NavigationToolbar"  Margin="0,0,0,0">
                <ComboBox x:Name="ComboHtmlViewer" Width="30" SelectedValue="MyFlowDocument" SelectedValuePath="Tag">
                    <ComboBoxItem Content="HtmlRenderer" Tag="HtmlRenderer"/>
                    <ComboBoxItem Content="MyFlowDocument" Tag="MyFlowDocument"/>
                    <ComboBoxItem Content="MSFlowDocument" Tag="MSFlowDocument"/>
                    <ComboBoxItem Content="Awesomium" Tag="Awesomium"/>
                    <ComboBoxItem Content="WebBrowser" Tag="WebBrowser"/>
                </ComboBox>
                <Button x:Name="DoNewWindow" Content="New" Click="DoNewWindow_Click"/>
                <Button Content="Forward"/>
                <Button x:Name="DoShowOrHide" Content="Show/Hide" Click="DoShowOrHide_Click"/>
                <Button Content="Back"/>
                <Button x:Name="DoOpenFile" Content="Open" Click="DoOpenFile_Click"/>
                <Button x:Name="DoTraceWorld" Content="Trace World" Click="DoTraceWorld_Click"/>
            </ToolBar>
            <ToolBar >
                <Button Content="Left"></Button>
            </ToolBar>
        </ToolBarPanel>
        <Grid x:Name="ViewerGrid" Grid.Column="1" Margin="10" Grid.Row="1"/>
        <RichTextBox x:Name="textHtml" Grid.Column="1" Margin="10,10,10,45" Grid.Row="2" Grid.ColumnSpan="2" IsReadOnly="True" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible">
            <RichTextBox.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Original" Click="MenuItem_Click_1"/>
                    <MenuItem Header="Moving"/>
                    <MenuItem Header="To full form"/>
                </ContextMenu>
            </RichTextBox.ContextMenu>
            <FlowDocument>
                <Paragraph>
                    <Run Text="..."/>
                </Paragraph>
            </FlowDocument>
        </RichTextBox>
    </Grid>
</Window>
